function  find(str) {
    let strs = str.trim().split("");

    let size = strs.length;
    let count = 0;
    for (let i = 0; i < size; i++) {
        //获取asc码
        let val = strs[i].charCodeAt() - 'A'.charCodeAt() +1;
        console.log("===",val);
        count += val * 26**i;
    }
    // count ++;//末位字母加1
    return count;
}

console.log(find("ZY"));
console.log(find("AA"));
console.log(find("B"));